package swu.cx.myhttpjava;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;

import okhttp3.OkHttpClient;

public class MainActivity extends AppCompatActivity {
    private String url = "http://apis.juhe.cn/simpleWeather/query";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        OkHttpClient client = new OkHttpClient();
        for (int i=0;i<10;i++){
            sendRequest();
        }
    }
    private void sendRequest(){
        MyHttp.sendJsonRequest(url, null, MyBean.class, new IJsonDataTransforListener<MyBean>() {

            @Override
            public void onSuccess(MyBean myBean) {
                Log.v("cx","返回的数据："+myBean.toString());
            }
        });
    }
}